<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui">
<h:head>
    <title>MeteoCal - HomePage</title>
    <h:outputStylesheet name="/css/stile.css" />
</h:head>
    <body>
        <div class="container">
        <h:form> 
            <h:commandLink action="#{loginBean.refreshPage()}"> 
                <h:graphicImage library="images" name="logoBianco.png" width="265" height="85" />
            </h:commandLink>
        </h:form>    
        </div>
        
        <div class="sfondo" style="background-image:url(#{resource['images/sfondoHome.png']}); 
             height: 80%; width: 100%;"> 
        <div class="login">
            <h:form> 
                <p:panel id="logForm" styleClass="logForm" style="max-width: 255px">
                    <h:panelGrid columns="1">

                        <p:inputText id="email" value="#{loginBean.email}" required="true" 
                                     placeholder="Email" label="Email"/> 
                        <p:message for="email"  />

                        <p:password id="password" value="#{loginBean.password}" required="true" 
                                    placeholder="Password" label="Password" /> 
                        <p:message for="password" />

                        <h:commandButton styleClass="logButton" value="Login"  action="#{loginBean.login()}"  />
                    </h:panelGrid>
                </p:panel>
            </h:form>

            <h:form>
                <p:panel styleClass="logForm" style="max-width: 255px">
                    <h:panelGrid columns="1" id="regGrid">
                        <h:outputLabel styleClass="message" for="email" value="#{loginBean.errore}"/>
                        
                        <p:inputText id="name" value="#{loginBean.name}" required="true" 
                                     placeholder="Name" label="Name"/>
                        <p:message for="name"/>

                        <p:inputText id="surname" value="#{loginBean.surname}" required="true" 
                                     placeholder="Surname" label="Surname"/>
                        <p:message for="surname" />

                        <p:inputText id="nickname" value="#{loginBean.nickname}" required="true" 
                                     placeholder="Nickname" label="Nickname"/>
                        <p:message for="nickname" />
                        
                        <p:inputText id="email" value="#{loginBean.email}" required="true" 
                                     placeholder="Email" label="Email"/>
                        <p:message for="email" />
                        
                        <p:password id="password" value="#{loginBean.password}"
                                    feedback="true" label="Password" required="true" placeholder="Password"/>
                        <p:message for="password" />


                        <h:commandButton styleClass="logReg" value="Sign up for MeteoCal"
                                         action="#{loginBean.register()}" />
                    </h:panelGrid>
                </p:panel>
            </h:form>
        </div>
      
        </div>
      
        
</body>
</html>

